<template>
    <div>
        <!--超链接 to='path'-->
<!--        <router-link to="/hello1">跳转hello1</router-link>-->
        <button @click="toHello1">跳转hello1</button>
        &nbsp;&nbsp;&nbsp;
        <router-link to="/hello2?msg=hahaha">跳转hello2</router-link>
        <!--挂载子页面的视图-->
        <router-view/>
    </div>
</template>

<script>
    export default {
        name: "HelloView",
        methods:{
            toHello1(){
                //代码跳转 push({path:路径}）
                this.$router.push({path:"/hello1",query:{msg:"hehehe"}})
            }
        }
    }
</script>

<style scoped>

</style>
